// 导入主题配置文件，包含颜色、字体等全局样式变量
import {theme} from "../../common/theme.js";

// 导出邮箱登录组件的CSS样式
export const css = `
    /* 组件宿主元素样式 - 设置为行内块元素 */
    :host {
        display: inline-block;
    }

    /* 邮箱登录容器 - 固定定位在页面顶部左侧，高层级显示 */
    .email-login-container {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
    }

    /* 登录触发按钮 - 自定义主色调为蓝色系 */
    .login-trigger-btn {
        --sl-color-primary-600: #60a5fa;
        --sl-color-primary-700: #3b82f6;
    }

    /* 登录模态框背景层 - 全屏覆盖，带毛玻璃效果和居中布局 */
    .login-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(8px);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* 模态框显示状态 - 完全可见 */
    .login-modal.show {
        opacity: 1;
        visibility: visible;
    }

    /* 登录表单容器 - 主要的登录界面卡片，包含阴影、圆角和动画效果 */
    .login-form-container {
        background: ${theme.bgc};
        border-radius: 16px;
        padding: 2rem 2.5rem;
        width: 450px;
        max-width: 90vw;
        box-shadow: 
            0 25px 50px -12px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(255, 255, 255, 0.05);
        transform: scale(0.9) translateY(-20px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* 表单容器显示动画 - 缩放和位移到正常状态 */
    .login-modal.show .login-form-container {
        transform: scale(1) translateY(0);
    }

    /* 关闭按钮 - 位于表单右上角，带毛玻璃背景效果 */
    .close-btn {
        position: absolute;
        top: 1.25rem;
        right: 1.25rem;
        --sl-color-neutral-600: rgba(255, 255, 255, 0.6);
        --sl-color-neutral-700: rgba(255, 255, 255, 0.8);
        z-index: 10;
    }

    /* 关闭按钮基础样式 - 半透明背景和毛玻璃效果 */
    .close-btn::part(base) {
        color: rgba(255, 255, 255, 0.6);
        transition: all 0.2s ease;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(10px);
    }

    /* 关闭按钮悬停效果 - 增强可见度和轻微缩放 */
    .close-btn:hover::part(base) {
        color: rgba(255, 255, 255, 0.9);
        background: rgba(255, 255, 255, 0.1);
        transform: scale(1.05);
    }

    /* 关闭按钮图标大小 */
    .close-btn sl-icon {
        font-size: 1.1rem;
    }

    /* 登录表单头部区域 - 居中对齐，包含标题和副标题 */
    .login-header {
        text-align: center;
        margin-bottom: 2rem;
        padding-top: 0.25rem;
    }

    /* 登录主标题 - 大字体，渐变色文字效果 */
    .login-title {
        font-size: 1.75rem;
        font-weight: 700;
        color: ${theme.tc};
        margin: 0 0 0.75rem 0;
        background: linear-gradient(135deg, #ffffff, #e5e7eb);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    /* 登录副标题 - 较小字体，半透明文字 */
    .login-subtitle {
        font-size: 0.9rem;
        color: rgba(255, 255, 255, 0.65);
        margin: 0;
        font-weight: 400;
    }

    /* 登录表单主容器 - 垂直布局，元素间有统一间距 */
    .login-form {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
    }

    /* 表单组容器 - 每个输入字段的包装器 */
    .form-group {
        margin-bottom: 1.5rem;
    }

    /* 表单标签 - 输入框上方的文字标签 */
    .form-label {
        display: block;
        font-size: 0.9rem;
        font-weight: 500;
        color: ${theme.tc};
        margin-bottom: 0.75rem;
        letter-spacing: 0.025em;
    }

    /* 登录输入框 - 自定义样式变量，透明背景，蓝色聚焦边框 */
    .login-input {
        width: 100%;
        --sl-input-border-color: rgba(255, 255, 255, 0.15);
        --sl-input-border-color-hover: rgba(255, 255, 255, 0.25);
        --sl-input-border-color-focus: #60a5fa;
        --sl-input-background-color: transparent;
        --sl-input-color: #ffffff;
        --sl-input-placeholder-color: rgba(255, 255, 255, 0.4);
        --sl-input-border-radius-medium: 8px;
        --sl-input-height-medium: 44px;
        --sl-spacing-small: 0.5rem;
        --sl-spacing-medium: 0.75rem;
    }

    /* 密码输入框特殊间距调整 - 为密码切换按钮预留更多空间 */
    .login-input[password-toggle] {
        --sl-spacing-small: 0.75rem;
        --sl-spacing-medium: 1rem;
    }

    /* 输入框基础容器样式 - 圆角、过渡动画和毛玻璃效果 */
    .login-input::part(base) {
        border-radius: 10px;
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
        font-size: 0.95rem;
    }

    /* 输入框内部文字颜色 */
    .login-input::part(input) {
        color: #ffffff;
    }

    /* 输入框前缀图标区域样式优化 - 左侧图标的间距设置 */
    .login-input::part(prefix) {
        padding-left: 0.75rem;
        padding-right: 0.5rem;
        margin-right: 0;
    }

    /* 输入框后缀图标区域样式优化 - 右侧密码显示图标的间距设置 */
    .login-input::part(suffix) {
        padding-right: 0.15rem;
        padding-left: 0.5rem;
        margin-right: 0;
        width: auto;
        min-width: 1rem;
    }

    /* 输入框内图标通用样式 - 大小和颜色设置 */
    .login-input sl-icon {
        font-size: 1rem;
        color: rgba(255, 255, 255, 0.6);
        margin-left: 0.25rem;
        margin-right: 0.25rem;
    }

    /* 输入框聚焦时图标颜色变化 - 变为蓝色主题色 */
    .login-input:focus-within sl-icon {
        color: #60a5fa;
        transition: color 0.2s ease;
    }

    /* 密码显示切换按钮特殊样式 - 确保与左侧图标对齐 */
    .login-input[password-toggle]::part(password-toggle-button) {
        margin-left: 0.75rem !important;
        padding-left: 0.5rem !important;
    }

    /* 密码切换按钮备用样式选择器 */
    .login-input[password-toggle] .password-toggle-button {
        margin-left: 0.75rem !important;
        padding-left: 0.5rem !important;
    }

    .captcha-container {
        display: flex;
        gap: 1rem;
        align-items: flex-start;
        background: rgba(255, 255, 255, 0.02);
        padding: 1rem;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .captcha-input {
        flex: 1;
    }

    .captcha-image-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        min-width: 120px;
    }

    .captcha-image {
        width: 120px;
        height: 45px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 8px;
        object-fit: cover;
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(10px);
        transition: all 0.2s ease;
    }

    .captcha-image:hover {
        border-color: rgba(255, 255, 255, 0.3);
        transform: scale(1.02);
    }

    .refresh-captcha-btn {
        --sl-color-primary-600: rgba(255, 255, 255, 0.6);
        --sl-color-primary-700: rgba(255, 255, 255, 0.8);
        font-size: 0.8rem;
        width: 100%;
        --sl-spacing-x-small: 0.25rem;
    }

    .refresh-captcha-btn::part(base) {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 6px;
        color: rgba(255, 255, 255, 0.8);
        transition: all 0.2s ease;
    }

    .refresh-captcha-btn:hover::part(base) {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.25);
        transform: translateY(-1px);
    }

    .refresh-captcha-btn sl-icon {
        font-size: 0.85rem;
        margin-left: 0.2rem;
        margin-right: 0.25rem;
    }

    .login-actions {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .login-btn {
        width: 100%;
        --sl-color-primary-600: #60a5fa;
        --sl-color-primary-700: #3b82f6;
        --sl-button-font-weight: 600;
        --sl-spacing-small: 0.5rem;
    }

    .login-btn::part(base) {
        border-radius: 10px;
        height: 48px;
        font-size: 1rem;
        background: linear-gradient(135deg, #60a5fa, #3b82f6);
        border: none;
        box-shadow: 0 4px 15px rgba(96, 165, 250, 0.3);
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }

    .login-btn:hover::part(base) {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(96, 165, 250, 0.4);
    }

    .login-btn sl-icon {
        font-size: 1rem;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .forgot-password {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.9rem;
        padding: 0 0.25rem;
    }

    .forgot-password-link,
    .register-account-link {
        color: #60a5fa;
        text-decoration: none;
        font-weight: 500;
        transition: all 0.2s ease;
        padding: 0.25rem 0;
        border-radius: 4px;
    }

    .forgot-password-link:hover,
    .register-account-link:hover {
        color: #93c5fd;
        text-decoration: underline;
        text-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
    }



    .error-message {
        color: #fca5a5;
        font-size: 0.8rem;
        margin-top: 0.5rem;
        min-height: 1.2rem;
        padding: 0.25rem 0.5rem;
        background: rgba(248, 113, 113, 0.1);
        border-radius: 6px;
        border-left: 3px solid #f87171;
    }

    .divider {
        display: flex;
        align-items: center;
        margin: 1.5rem 0;
        color: rgba(255, 255, 255, 0.5);
        font-size: 0.9rem;
        font-weight: 500;
    }

    .divider::before,
    .divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    }

    .divider span {
        padding: 0 1.5rem;
        background: ${theme.bgc};
        color: rgba(255, 255, 255, 0.6);
        position: relative;
    }

    .social-login {
        display: flex;
        gap: 1rem;
    }

    .social-btn {
        flex: 1;
        --sl-color-neutral-600: rgba(255, 255, 255, 0.7);
        --sl-color-neutral-700: rgba(255, 255, 255, 0.9);
        --sl-button-font-weight: 500;
        --sl-spacing-small: 0.5rem;
    }

    .social-btn::part(base) {
        border-radius: 10px;
        height: 44px;
        border: 1px solid rgba(255, 255, 255, 0.15);
        background: rgba(255, 255, 255, 0.05);
        color: rgba(255, 255, 255, 0.8);
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
    }

    .social-btn:hover::part(base) {
        border-color: rgba(255, 255, 255, 0.25);
        background: rgba(255, 255, 255, 0.1);
        transform: translateY(-1px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }

    .social-btn sl-icon {
        font-size: 1rem;
        margin-left: 0.25rem;
        margin-right: 0.5rem;
    }

    .error-message {
        color: var(--sl-color-danger-600);
        font-size: 0.875rem;
        margin-top: 0.5rem;
        display: none;
    }

    .error-message.show {
        display: block;
    }

    .loading {
        pointer-events: none;
        opacity: 0.7;
    }

    /* 响应式设计 */
    @media (max-width: 768px) {
        .login-form-container {
            padding: 2rem;
            width: 95vw;
            margin: 1rem;
        }

        .login-title {
            font-size: 1.5rem;
        }

        .captcha-container {
            flex-direction: column;
            gap: 1rem;
            padding: 1rem;
        }

        .captcha-image-container {
            align-items: center;
            min-width: auto;
        }

        .captcha-image {
            width: 140px;
            height: 50px;
        }

        .refresh-captcha-btn {
            width: 140px;
        }
    }

    @media (max-width: 480px) {
        .login-form-container {
            padding: 1.5rem;
            width: 95vw;
            border-radius: 12px;
        }

        .login-title {
            font-size: 1.25rem;
        }

        .login-subtitle {
            font-size: 0.85rem;
        }

        .social-login {
            flex-direction: column;
            gap: 0.75rem;
        }

        .captcha-container {
            padding: 0.75rem;
        }

        .captcha-image {
            width: 120px;
            height: 45px;
        }

        .refresh-captcha-btn {
            width: 120px;
            font-size: 0.75rem;
        }

        .form-group {
            margin-bottom: 1.5rem;
        }

        .login-actions {
            gap: 1rem;
        }

        .forgot-password {
            flex-direction: column;
            gap: 0.75rem;
            text-align: center;
        }
    }

    /* 深色主题增强 */
    @media (prefers-color-scheme: dark) {
        .login-modal {
            background: rgba(0, 0, 0, 0.9);
        }

        .login-form-container {
            box-shadow: 
                0 25px 50px -12px rgba(0, 0, 0, 0.7),
                0 0 0 1px rgba(255, 255, 255, 0.08);
        }
    }

    /* 动画效果 */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .login-modal.show .login-form-container {
        animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
`;